<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        ul {
            list-style: none;
        }

        /* 图片410 * 170  */
        .wrapper {
            width: 600px;
            margin: 0 auto;
            overflow: hidden;
        }

        .wrapper .section .move {
            width: 3050px;
            position: relative;
            /* right: 10px; */
        }


        .wrapper .section .photo {
            float: left;
        }

        .wrapper .section .photo img {
            width: 600px;
            height: 220px;
        }

        .wrapper .section .menu ul {
            position: fixed;
            width: 600px;
            background-color: rgba(227, 226, 226, 0.5);
            top: 190px;
        }

        .wrapper .section .menu ul li {
            width: 120px;
            height: 30px;
            float: left;
            font-size: 7px;
            text-align: center;
            line-height: 30px;
        }

        .active {
            background-color: rgb(247, 246, 246);
        }
    </style>
    <script src="../js/jquery.min.js"></script>
    <script>
        $(function () {
            // 轮播图
            var index = 0;
            var timer = null;
            timer = setInterval(function () {
                index++;
                if (index == 5) {
                    index = 0;
                }
                console.log(index);
                $(".move").animate({
                    "left": -(index * 600)
                })
                $(".wrapper .menu ul li").eq(index).addClass("active").siblings("li").removeClass("active")
            }, 2000)


            // 进入盒子取消定时器
            $(".wrapper ").mouseenter(function () {
                clearInterval(timer)
            })

            // 移出盒子开启定时器
            $(".wrapper").mouseleave(function () {
                
            })

            // 点击切换对应的图片
            $(".wrapper .menu ul li").click(function () {
                var index = $(this).index();
                console.log(index);
                $(this).addClass("active").siblings("li").removeClass("active");
                $(".move").stop().animate({
                    "left": -(index * 600)
                })
            })

        })
    </script>
</head>

<body>

    <div class="wrapper">
        <div class="section">
            <div class="move">
                <div class="photo">
                    <img src="./images/1.jpg" alt="">
                </div>
                <div class="photo">
                    <img src="./images/2.jpg" alt="">
                </div>
                <div class="photo">
                    <img src="./images/3.jpg" alt="">
                </div>
                <div class="photo">
                    <img src="./images/4.jpg" alt="">
                </div>
                <div class="photo">
                    <img src="./images/5.jpg" alt="">
                </div>
            </div>
            <div class="menu">
                <ul>
                    <li class="active">银河太空秘宝</li>
                    <li>魔女 婕拉 至臻</li>
                    <li>2020LPL春季赛季后赛</li>
                    <li>创世魔神2020</li>
                    <li>每周限时优惠</li>
                </ul>
            </div>
        </div>
    </div>
</body>

</html>



<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box2 {
            margin-top: 10px;
        }

        .box3 {
            width: 110px;
            margin-top: 10px;
        }
    </style>
    <script src="../js/jquery.min.js"></script>
    <script>
        $(function () {
          
            // 添加
            // console.log( $(".warrper button"));
            $(".wrapper button").eq(0).click(function () {
                var value = $(".wrapper input").val()
                // console.log(value);
                if (value.length == 0) {
                    alert("请输入要添加的选项")
                    return
                }
                $(".wrapper .box3").append("<input type='checkbox'>" + value)
                $(".wrapper input").val("")
            })

            // 全选
            $(".wrapper button").eq(1).click(function () {
                // console.log(( $(".wrapper .box3 input")))

                $(".wrapper .box3 input").prop("checked", true)

            })


            // 全不选
            $(".wrapper button").eq(2).click(function () {

                $(".wrapper .box3 input").prop("checked", false)

            })


            // 反选
            $(".wrapper button").eq(3).click(function () {
                $(".wrapper .box3 input").each(function () {
                    console.log($(this));
                    if ($(this).prop("checked") == false) {
                        $(this).prop("checked", true)
                    } else if ($(this).prop("checked") == true) {
                        $(this).prop("checked", false)
                    }
                })
            })

            // 删除所选
            $(".wrapper button").eq(4).click(function () {
                  var arr = [];
                  console.log(arr);
                // var index=$(".wrapper .box3 input");
                $(".wrapper .box3 input").each(function (index, item) {
                                    
                    if ($(item).prop("checked") == true) {
                        $(item).parent("label").remove();
                    }
                    arr.push($(item).prop('checked')); 
                })
                if (arr.indexOf(true) == -1) {
                    alert("请选择要删除的选项")
                }
            })
        })
    </script>
</head>

<body>
    <div class="wrapper">
        <input type="text" placeholder="请输入需要添加选项">
        <button>添加</button>

        <div class="box2">
            <button>全选</button>
            <button>全不选</button>
            <button>反选</button>
            <button>删除所选</button>
        </div>

        <div class="box3">
            <label> <input type="checkbox">家里没宽带</label>
            <label> <input type="checkbox">网速不够快</label>
            <label> <input type="checkbox">手机没流量</label>
            <label> <input type="checkbox">学校妹wifi</label>
        </div>
    </div>

</body>

</html>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        body{
            background: url(./images/bg.jpg)  center top;
     
        }
        .wrapper{
            width: 1089px;
            /* height: 429px; */
            margin:262px auto;
            /* background-color: red; */
        }
        .wrapper .item{
            float: left; 
            cursor: pointer;
        }
        .wrapper .item p{
            display: block;
            width: 14px;
            /* height: 359px; */
            margin-top: 70px;
            margin-left: 50px;
           background-color: rgba(0, 0,0,0.1);
            color: white;
            text-align:  center;
           
        }
        .wrapper .item:nth-child(1){
            width: 789px;
            height: 429px;
            background: url(./images/1.jpg);
        }
        .wrapper .item:nth-child(2){
            width: 100px;
            height: 429px;
            background: url(./images/2.jpg);
        }
        .wrapper .item:nth-child(3){
            width: 100px;
            height: 429px;
            background: url(./images/3.jpg);
        }
        .wrapper .item:nth-child(4){
            width: 100px;
            height: 429px;
            background: url(./images/4.jpg);
        }

    </style>
</head>
<body>
    <!-- 789*429 -->
    <div class="wrapper">
        <div class="item">
            <p>我的个人拉萨之旅 | | 故事之城</p>
        </div>
        <div class="item">
            <p>我的个人拉萨之旅 | | 故事之城</p>
        </div>
        <div class="item">
            <p>我的个人拉萨之旅 | | 故事之城</p>
        </div>
        <div class="item">
            <p>我的个人拉萨之旅 | | 故事之城</p>
        </div>
    </div>
    
    <script src="../教师文件/02-jQuery-代码/4-代码/js/jquery.min.js"></script>
   <script>
       $(function(){
           $(".wrapper .item").click(function(){
               // console.log( $(this));
               $(this).siblings().stop().animate({
                   "width":"100px"
               })
               $(this).stop().animate({
                   "width":"789px"
               })
           })
       })
   </script>

</body>
</html>


<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
	<title>购物车-美丽说</title>
	<meta name="description" content="彷美丽说" />
	<meta name="keywords" content="彷美丽说" />
    <!-- 引入facicon.ico网页图标 -->
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <!-- 引入css 初始化的文件 -->
    <link rel="stylesheet" href="css/base.css">
    <!-- 引入car css -->
    <link rel="stylesheet" href="css/car.css">
    <!-- 引入jquery文件 -->
    <script src="js/jquery.min.js"></script>
    <!-- 引入car.js文件 -->
    <script src="js/car.js"></script>
</head>
    
<body>

    <div class="c-container">
        <div class="w">
            <div class="cart-filter-bar">
                <em>全部商品</em>
            </div>
            <!-- 购物车主要核心区域 -->
            <div class="cart-warp">
                <!-- 头部全选模块 -->
                <div class="cart-thead">
                    <div class="t-checkbox">
                        <input type="checkbox" class="checkall"> 全选
                    </div>
                    <div class="t-goods">商品</div>
                    <div class="t-price">单价</div>
                    <div class="t-num">数量</div>
                    <div class="t-sum">小计</div>
                    <div class="t-action">操作</div>
                </div>
                <!-- 商品详细模块 -->
                <div class="cart-item-list">
                    <div class="cart-item check-cart-item">
                        <div class="p-checkbox">
                            <input type="checkbox" checked class="j-checkbox">
                        </div>
                        <div class="p-goods">
                            <div class="p-img">
                                <img src="images/goods01.png">
                            </div>
                            <div class="p-msg">小清新新款韩版气质收腰显瘦百搭蕾丝边V领木耳边镂空休闲连衣裙</div>
                        </div>
                        <div class="p-price">￥72.60</div>
                        <div class="p-num">
                            <div class="quantity-form">
                                <a href="javascript:void(0);" class="decrement">-</a>
                                <input type="text" class="itxt" value="1">
                                <a href="javascript:void(0);" class="increment">+</a>
                            </div>
                        </div>
                        <div class="p-sum">￥72.60</div>
                        <div class="p-action"><a href="javascript:void(0);">删除</a></div>
                    </div>
                    <div class="cart-item">
                        <div class="p-checkbox">
                            <input type="checkbox" class="j-checkbox">
                        </div>
                        <div class="p-goods">
                            <div class="p-img">
                                <img src="images/goods02.png">
                            </div>
                            <div class="p-msg">小个子韩版春夏新款小清新荷叶边中长款v领碎花雪纺吊带连衣裙</div>
                        </div>
                        <div class="p-price">￥84.80</div>
                        <div class="p-num">
                            <div class="quantity-form">
                                <a href="javascript:void(0);" class="decrement">-</a>
                                <input type="text" class="itxt" value="1">
                                <a href="javascript:void(0);" class="increment">+</a>
                            </div>
                        </div>
                        <div class="p-sum">￥84.80</div>
                        <div class="p-action"><a href="javascript:void(0);">删除</a></div>
                    </div>
                    <div class="cart-item">
                        <div class="p-checkbox">
                            <input type="checkbox" class="j-checkbox">
                        </div>
                        <div class="p-goods">
                            <div class="p-img">
                                <img src="images/goods03.png">
                            </div>
                            <div class="p-msg">夏季新款名媛气质吊带碎花连衣裙露肩波西米亚度假长裙甜美沙滩裙</div>
                        </div>
                        <div class="p-price">￥69.80</div>
                        <div class="p-num">
                            <div class="quantity-form">
                                <a href="javascript:void(0);" class="decrement">-</a>
                                <input type="text" class="itxt" value="1">
                                <a href="javascript:void(0);" class="increment">+</a>
                            </div>
                        </div>
                        <div class="p-sum">￥69.80</div>
                        <div class="p-action"><a href="javascript:void(0);">删除</a></div>
                    </div>
                </div>

                <!-- 结算模块 -->
                <div class="cart-floatbar">
                    <div class="select-all">
                        <input type="checkbox" class="checkall">全选
                    </div>
                    <div class="operation">
                        <a href="javascript:void(0);" class="remove-batch"> 删除选中的商品</a>
                        <a href="javascript:void(0);" class="clear-all">清理购物车</a>
                    </div>
                    <div class="toolbar-right">
                        <div class="amount-sum">已经选<em>1</em>件商品</div>
                        <div class="price-sum">总价： <em>￥72.60</em></div>
                        <div class="btn-area">去结算</div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</body>

</html>


